from selenium import webdriver
import time

path = "phantomjs.exe"
url = "https://www.baidu.com"

browse = webdriver.PhantomJS(path)
browse.get(url)

browse.save_screenshot('baidu.png')
input = browse.find_element_by_id('kw')
input.send_keys("千与千寻")
time.sleep(2)
browse.save_screenshot('qianxun.png')
browse.quit()